<include file="Public:header" />

<div id="page-body">
    <div id="qan-breadcrumbs">
    	<span><a href="{$_global.site_url}">{$Think.lang.home}</a></span>&gt;&nbsp;
    	<span><a href="{:U('Team/index')}">{$Think.lang.all_teams}</a></span>&gt;&nbsp;
    	<span>{$team.name|input::forShow}</span>
    	<eq name="team.leader_id" value="$_user.user_id">
    	<span>&gt;&nbsp;<a href="{:U('Team/setting',array('tid'=>$team['team_id']))}">{$Think.lang.team_settings}</a></span>
    	</eq>
    </div>
    <div id="qan-content">
        <div id="user-container" class="container">
            <div id="user-profile">
                <div id="info">
                    <eq name="user.user_id" value="$_user.user_id">
                    <a href="http://en.gravatar.com/" title="{$Think.lang.user_change_avatar}"><img class="avatar" src="{$user.email|get_avatar=###,96}" /></a>
                    <else/>
                    <img class="avatar" src="{$user.email|get_avatar=###,96}" />
                    </eq>
                    <p class="percent"><span class="best-answer">{$team.best_answer_count|get_percentage=$team['answer_count']}%</span>{$Think.lang.best_answer}</p>
                </div>
                <div id="summary">
                    <h1>{$team.name|Input::forShow}<span></h1>
                    <ul class="meta">
                        <li>{$Think.lang.team_since}: {$team.create_time|format_date='Y-m-d'}</li>
                        <li>{$Think.lang.team_leader}: <a href="{$team.leader_id|format_team_url=$team['leader_name']}">{$team.leader_name}</a></li>
                        <li><span>{$Think.lang.team_user_count}: (<a href="{:U('Team/userlist',array('tid'=>$team['team_id']))}">{$team.user_count}</a>)</span></li>
                        <li><span>{$Think.lang.team_category}: {$team.category_id|get_category_path}</span></li>
                        <notempty name="team.tags">
                        <li class="tags">{$Think.lang.team_tags}:
                        <volist name="team.tags" id="vo">
                        	<a href="{$vo.tag_id|format_tag_url=$vo['name']}">{$vo.name}</a><neq name="team.tags|count" value="$key+1">&nbsp;-&nbsp;</neq>
                        </volist>
                        </li>
                        </notempty>
                    </ul>
                </div>
            </div>
            <div id="user-point-level">
                <ul>
                    <li><span>{$team.point_count}</span> {$Think.lang.total_points}</li>
                    <li><span>{$team.answer_count}</span> {$Think.lang.total_answers}</li>
                    <li><span>{$team.best_answer_count}</span> {$Think.lang.total_best_answers}</li>
                </ul>
                <notempty name="team.medals">
                <div class="medals">
                    <volist name="team.medals" id="vo">
                    <img src="__PUBLIC__/Images/Medals/{$vo.image}" title="{$vo.description}" alt="{$vo.description}" />
                    </volist>
                </div>
                </notempty>
            </div>
            <div id="user-about">
                <h2 onclick="aboutToggle(this)">{$Think.lang.team_about}<span class="expand">expand</span></h2>
                <div class="content">{$team.about|parse_markup}</div>
            </div>
        </div>
		
        <!-- team qa -->
        <div id="user-qa">
            <ul id="qa-nav" class="tabs">
                <li class="current"><a href="{:U('Team/qa',array('tid'=>$team['team_id'],'type'=>'all'))}">{$Think.lang.team_all_answers}</a></li>
                <li><a href="{:U('Team/qa',array('tid'=>$team['team_id'],'type'=>'recent'))}">{$Think.lang.team_recent_answers}</a></li>
                <li><a href="{:U('Team/qa',array('tid'=>$team['team_id'],'type'=>'teamwork'))}">{$Think.lang.team_teamwork_answers}</a></li>
                <li><a href="{:U('Team/qa',array('tid'=>$team['team_id'],'type'=>'best'))}">{$Think.lang.team_best_answers}</a></li>
            </ul>
            <notempty name="questions">
            <ul class="questions">
                <volist name="questions" id="vo" mod="2">
                <li class="item <eq name="mod" value="0">alt</eq>">
                    <div class="avatar"><a href="{$vo.user_id|format_user_url=$vo['username']}"><img src="{$vo.email|get_avatar}" alt="{$vo.username}" /></a></div>
                    <div class="info">
                        <h3><a href="{$vo.question_id|format_question_url=$vo['title']}">{$vo.title}</a> - <span class="status">{$vo.status|get_question_status}</span></h3>
                        <ul class="meta">
                            <li class="stars"><a href="#nogo"><span class="star-count has-stars">{$vo.star_count}</span><span class="star">Stars</span></a></li>
                            <li>{$Think.lang.asked_by} <a href="{$vo.user_id|format_user_url=$vo['username']}">{$vo.username}</a> - </li>
                            <li>{$Think.lang.in} <a href="{$vo.category_id|format_category_url}">{$vo.category_id|get_category_name}</a> - </li>
                            <li>{$vo.answer_count} {$Think.lang.answer_count} - </li>
                            <li><abbr title="{$vo.create_time|format_date}">{$vo.create_time|pretty_date}</abbr></li>
                        </ul>
                    </div>
                </li>
                </volist>
                <li class="more"><a class="btn" href="{:U('Team/qa',array('tid'=>$team['team_id'],'type'=>'all'))}">{$Think.lang.more_answers}</a></li>
            </ul>
            <else/>
            <p class="no-results">{$Think.lang.user_no_results}</p>
            </notempty>
        </div>

        <!-- team activities -->
        <div id="team-activities">

        </div>
    </div>

    <div id="qan-sidebar">
        <include file="Team:sidebar" />
    </div>
</div>

<script type="text/javascript">
function aboutToggle(obj){
    var flag = $(obj).find('span');
    $('#team-about>.content').toggle();
    if(flag.attr('class') == 'expand'){
        flag.attr('class','collapse');
    }else{
        flag.attr('class','expand');
    }
}
</script>

<include file="Public:footer" />